<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<%@include file="/view/main/stylesheet.jsp"%>
<link rel="stylesheet" type="text/css" href="${baseurl}/styles/frameword/css/list.css" />
<script src="${baseurl}/styles/frameword/js/list.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
	var url = "/pro-video-reward/";
	$(function() {
		var url = "/pro-video-reward/";
		var columns = [
				{
					field : 'userName',
					title : '终端名'
				},
				{
					field : 'mobile',
					title : '手机号'
				},
				{
					field : 'vehicleNumber',
					title : '车牌号'
				},
				{
					field : 'vehicleModel',
					title : '车型'
				},
				{
					field : 'getTime',
					title : '抢单时间',
					formatter : function(value, row, index) {
						return format(new Date(value), 'yyyy-MM-dd hh:mm:ss');
					}
				},
				{
					field : 'money',
					title : '红包（元）',
					formatter : function(value, row, index) {
						return (value / 100).toFixed(2);
					}
				},
				{
					field : 'playedTime',
					title : '已播时长（小时）'
				},
				{
					field : 'playeTime',
					title : '应播放长（小时）'
				},
				{
					field : 'operate',
					title : '操作',
					align : 'center',
					events : {
						'click .BtnOfComplete' : function(e, value, row, index) {
							layer.confirm('确定删除中终端?', {
								btn : [ '删除', '取消' ]
							}, function() {
								$.get(baseUrl + url + '/delterminal/'
										+ row.primaryKey, function(result) {
									if (result) {
										$("#table1").bootstrapTable('refresh');
										layer.msg('操作成功', {
											icon : 1,
											time : 1000
										});
									}
								}, "json");
							}, function() {
								layer.closeAll('dialog');
							});
						},
						'click .BtnOfRefuse' : function(e, value, row, index) {
							layer.confirm('确定收回红包?', {
								btn : [ '删除', '取消' ]
							}, function() {
								$.get(
										baseUrl + url + '/rake/'
												+ row.primaryKey, function(
												result) {
											if (result) {
												$("#table1").bootstrapTable(
														'refresh');
												layer.msg('操作成功', {
													icon : 1,
													time : 1000
												});
											}
										}, "json");
							}, function() {
								layer.closeAll('dialog');
							});
						}
					},
					formatter : function(value, row, index) {
						return [
								'<span class="BtnOfDetails pointer glyphicon glyphicon-list" style="margin-right:15px;">刪除</span>',//
								'<span class="BtnOfUpdate pointer glyphicon glyphicon-edit" style="margin-right:15px;">收回红包</span>', ]
								.join('');
					},
				} ];
		initListDefault(url, columns)
	})
</script>
</head>
<body class="container-fluid">
	<form class="bs-example bs-example-form" role="form" id="form1">
		<input type="hidden" name="state" value="release"> <input type="hidden" name="videoId" value="${videoId}">
		<table class="table noline">
		</table>
	</form>
	<table id="table1">
	</table>
</body>

</html>